package cn.wubo.vrr.help.controller;

import cn.wubo.vrr.help.schedule.EhrAllSchedule;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.lang.reflect.InvocationTargetException;

@RestController
@RequestMapping("/ehr")
public class EhrController {

    @Autowired
    EhrAllSchedule ehrAllSchedule;

    @RequestMapping(value = "/getAll")
    @ResponseBody
    public String getAll() throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
        ehrAllSchedule.getEhrAllSchedule();
        return "完成";
    }

    @RequestMapping(value = "/get/{emplid}")
    @ResponseBody
    public JSONObject getAll(@PathVariable String emplid) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
        return ehrAllSchedule.getEhr(emplid);
    }

}
